#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <math.h>


int n;
char record[11009][100];
int  hashcode[11009];
int   lenlist[11009];

int bit[30];

inline int gethash(char *s)
{
    int i, ans=0;     
    for (i=0; s[i]!=0; ++i)
        ans |= bit[ s[i]-'a' ];
    return ans;
}    
  
bool findone, issame;

bool checktype1(char *a, char *b) // a longer than b
{
    int i, j, k, len1, len2;
	
	len1 = strlen(a);
	len2 = strlen(b);	
	if ((len1-len2)!=1) return false;
	for (i=0; i<len1; ++i)
	{
		for (j=0, k=0; j<len1; ++j)
		{
			if (j!=i)
			{
				if (a[j] != b[k]) break;
				k++;
			}
		}
		if (k==len2) return true;
	}    
	return false;
}    

inline bool comp(char * a, char * b, int code)
{
    int len1, len2, diff, i; 
    len1=strlen(a);
    len2=strlen(b);
    //if ((len1!=len2) && (abs(len1-len2)!=1)) return false;
    diff = 0;
    for (i=0; i<26; ++i)
        if (code & bit[i]) diff++;
  if (diff <=2)
    if (len1 == len2)
    {
        diff = 0;        
        for (i=0; i<len1; ++i)
           if (a[i] != b[i])           
               diff++;
        if (diff==1) return true;
        if (diff!=2) return false;
        
        diff = 0;
        for (i=1; i<len1; ++i)
           if (a[i]==b[i-1] && a[i-1]==b[i] && a[i]!=a[i-1])
               diff++;
        if (diff==1) return true;
        return false;
    }   
    else
    {
        if (len1>len2) return checktype1(a, b);
        else return checktype1(b, a);
    }      
	return false;
}    

int main()
{
    int i , j, len;
	char ss[100];
//	string tmp;
/*
	while (1)
	{
		char s1[100], s2[100];
		scanf("%s%s", s1, s2);
		char *p1=s1;
		char *p2=s2;
		printf("result:%d\n", comp(s1, s2));
	}
//*/ 
    bit[0]=1;
    for (i=1; i<26; ++i)
       bit[i] = bit[i-1]<<1;
    
    scanf("%d", &n);        
    for (i=0; i<n; ++i)
    {    
		scanf("%s", record[i]);
		hashcode[i] = gethash(record[i]);
		lenlist[i] = strlen(record[i]);
    }		
		
    int ncase;
  
	scanf("%d", &ncase);
    while( ncase-- )
    {
        //cin >> tmp;
		scanf("%s", ss);
		j = gethash(ss);
		len = strlen(ss);
        findone = false;
        issame = false;
		for (i=0; i<n; ++i)			
		   if (j == hashcode[i])
			if (strcmp(ss,record[i])==0) 
			{
				findone = true;
				issame = true;
				break;
			}
		if (!findone)
            for (i=0; i<n && !findone; ++i)
            {
                if (len==lenlist[i] || abs(len-lenlist[i])==1)
                    if (comp(ss, record[i], j^hashcode[i])==true) 
                    {
                        findone=true;
                        break;
                    }   
            }     
        if (findone) 
        {
            if (issame==true) printf("%s is correct\n", ss);
            else printf("%s is a misspelling of %s\n", ss, record[i]);
        }	
        else
        {
            printf("%s is unknown\n", ss);
        }    	
    }   
         
    return 0;    
}    


